package com.genius.unite_platform.hrm.controller;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.genius.adminmanager.other.entity.ResponseJson;
import com.genius.unite_platform.haocai.service.HaocaiService;
import com.genius.unite_platform.hrm.service.Hrm_jhService;
import com.genius.workflow.log.ControllerLog;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Hrm_jhSelectController {
	@Autowired
    @Qualifier("hrm_jhSelectService")
    private Hrm_jhService hrmSelectService;
    @RequestMapping("/hrm_jh/toIndex")
    public String toIndex(){
        return "/views/unite_platform/hrm_jh/daoru_dudao";
    }
    @RequestMapping("/hrm_jh/tofendian")
    public String tofendian(){
        return "/views/unite_platform/hrm_jh/daoru_fendian";
    }
    @RequestMapping("/hrm_jh/tozongjian")
    public String tozongjian(){
        return "/views/unite_platform/hrm_jh/daoru_zongjian";
    }
    @RequestMapping("/hrm_jh/tojxsh")
    public String tojxsh(){
        return "/views/unite_platform/hrm_jh/jxsh_select";
    }
    @RequestMapping("/hrm_jh/tojxsh_insert")
    public String tojxsh_insert(){
        return "/views/unite_platform/hrm_jh/jxsh_insert";
    }
    @RequestMapping("/hrm_jh/tojxcx_dudao")
    public String jxcx_dudao(){
        return "/views/unite_platform/hrm_jh/jxcx_dudao";
    }
    @RequestMapping("/hrm_jh/tojxcx_feidudao")
    public String jxcx_feidudao(){
        return "/views/unite_platform/hrm_jh/jxcx_feidudao";
    }
	/**
	 * 跳转到新的查看页面
	 */
	@PostMapping("/hrm_jh/toSearch")
	public String toSearch(){
		return "/views/unite_platform/hrm_jh/jxsh_search";
	}
	/**
	 * 批量导入
	 * @param session
	 * @return
	 * @throws Exception
	 */
	@ControllerLog(description="导入金虎督导管店表")
	@PostMapping("/hrm_jh/import_dudao")
	@ResponseBody
	public JSONObject import_dudao(@RequestBody JSONObject json,HttpSession session){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.import_dudao(json, response,session);
		return response;
	}
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="查询督导管点表")
    @PostMapping("/hrm_jh/get_dudao")
    @ResponseBody
    public JSONObject get_dudao(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = hrmSelectService.get_dudao(json, response);
        return response;
    }
    
	/**
	 * 批量导入
	 * @param session
	 * @return
	 * @throws Exception
	 */
	@ControllerLog(description="导入金虎分店目标")
	@PostMapping("/hrm_jh/import_fendian")
	@ResponseBody
	public JSONObject import_fendian(@RequestBody JSONObject json,HttpSession session){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.import_fendian(json, response,session);
		return response;
	}
	   /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="查询金虎分店目标")
    @PostMapping("/hrm_jh/get_fendian")
    @ResponseBody
    public JSONObject get_fendian(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = hrmSelectService.get_fendian(json, response);
        return response;
    }
    /**
	 * 批量导入
	 * @param session
	 * @return
	 * @throws Exception
	 */
	@ControllerLog(description="导入金虎分店目标")
	@PostMapping("/hrm_jh/import_zongjian")
	@ResponseBody
	public JSONObject import_zongjian(@RequestBody JSONObject json,HttpSession session){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.import_zongjian(json, response,session);
		return response;
	}
	/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="查询金虎分店目标")
	 @PostMapping("/hrm_jh/get_zongjian")
	 @ResponseBody
	 public JSONObject get_zongjian(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = hrmSelectService.get_zongjian(json, response);
	     return response;
	 }
	/**
	 * 新增填充操作
	 */
	@PostMapping("/hrm_jh/fillAdd")
	@ResponseBody
	public JSONObject fillAdd(@RequestBody JSONObject json){
	
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.fillAdd(json, response);
		return response;
	}
	/**
	 * 编辑填充操作
	 */
	@PostMapping("/hrm_jh/fillEdit")
	@ResponseBody
	public JSONObject fillEdit(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.fillEdit(json, response);
		return response;
	}
	/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="查询金虎分店目标")
	 @PostMapping("/hrm_jh/getSelectBody")
	 @ResponseBody
	 public JSONObject getSelectBody(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = hrmSelectService.getSelectBody(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="查询金虎分店目标")
	 @PostMapping("/hrm_jh/getBody")
	 @ResponseBody
	 public JSONObject getBody(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = hrmSelectService.getBody(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="查询")
	 @PostMapping("/hrm_jh/getsearch")
	 @ResponseBody
	 public JSONObject getsearch(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = hrmSelectService.getsearch(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="查询")
	 @PostMapping("/hrm_jh/getperformance")
	 @ResponseBody
	 public JSONObject getperformance(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = hrmSelectService.getperformance(json, response);
	     return response;
	 }
	/**
	 * 添加操作
	 * @param session
	 * @return
	 * @throws Exception
	 */
	@ControllerLog(description="添加信息")
	@PostMapping("/hrm_jh/add")
	@ResponseBody
	public JSONObject dictadd(@RequestBody JSONObject json,HttpSession session){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.add(json, response,session);
		return response;
	}
	/**
	 * 删除操作
	 */
	@ControllerLog(description="删除绩效")
	@PostMapping("/hrm_jh/batchdel")
	@ResponseBody
	public JSONObject batchdel(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	hrmSelectService.batchdel(json, response);
		return response;
	}
	/**
	 * 审核
	 */
	@ControllerLog(description="审核绩效")
	@PostMapping("/hrm_jh/toshenhe")
	@ResponseBody
	public JSONObject shenhe(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	hrmSelectService.shenhe(json, response);
		return response;
	}
	/**
	 * 审核
	 */
	@ControllerLog(description="作废绩效")
	@PostMapping("/hrm_jh/tozuofei")
	@ResponseBody
	public JSONObject zuofei(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	hrmSelectService.zuofei(json, response);
		return response;
	}
	/**
	 * 导出操作
	 */
	@ControllerLog(description="导出督导绩效")
	@PostMapping("/hrm_jh/dudao_exportExcel")
	public JSONObject dudao_exportExcel(HttpServletRequest request,HttpServletResponse responseServlet){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.dudao_exportExcel(request, responseServlet, response);
		return response;
	}
	/**
	 * 导出操作
	 */
	@ControllerLog(description="导出非督导绩效")
	@PostMapping("/hrm_jh/feidudao_exportExcel")
	public JSONObject feidudao_exportExcel(HttpServletRequest request,HttpServletResponse responseServlet){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.feidudao_exportExcel(request, responseServlet, response);
		return response;
	}
	/**
	 * 导出操作
	 */
	@ControllerLog(description="导出")
	@PostMapping("/hrm_jh/exportExcel")
	@ResponseBody
	public JSONObject exportExcel(HttpServletRequest request,HttpServletResponse responseServlet){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = hrmSelectService.exportExcel(request, responseServlet, response);
		return response;
	}
}
